﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserLicense.aspx.cs" Inherits="WMS6.Web.TaskMgmt.UserLicense" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>FlowThruAllocation</title>
    <link href="../style/zh/1/css.css" type="text/css" rel="Stylesheet" id="mycss" />
    <link href="../Css/style.css" type="text/css" rel="stylesheet" />

    <script src="../Js/jquery.js" type="text/javascript"></script>

    <script src="../Js/jquery.simplemodal.js" type="text/javascript"></script>

    <script src="../Js/util.js" type="text/javascript"></script>

    <script src="../Js/InitPage.js" type="text/javascript"></script>

    <script src="../Js/Verification.js" type="text/javascript"></script>

    <script src="../Js/checkbox.js" type="text/javascript"></script>

    <script src="../Js/calendar.js" type="text/javascript" charset="gb2312"></script>

    <script type="text/javascript">
        //初始化页面
        window.onload = function() {
            initEditNewPage();
        }

        function newUserLicense() {
            var from = document.getElementById("hdnFrom").value;
            window.location.href = "UserLicense.aspx?from=" + escape(from);
            return false;
        }
        //弹出窗口选择货位
        function selectUser(value) {
            var rtnValue = popModalWindow('../Administration/UserQuery.aspx?action=txtUserID', 'dialogWidth=800px;dialogHeight=500px;center=yes;resizable=yes;status=no;');
            if (rtnValue != null && rtnValue.toString() != "") {
                document.getElementById('txtUserID').focus();
                document.getElementById('txtUserID').value = rtnValue;
            }
        }

        //弹出窗口选择货位
        function selectDispatchRule(value) {
            var rtnValue = popModalWindow('../Configuration/DispatchRuleQuery.aspx?action=txtUserID', 'dialogWidth=800px;dialogHeight=500px;center=yes;resizable=yes;status=no;');
            if (rtnValue != null && rtnValue.toString() != "") {
                document.getElementById('txtTaskStrategyID').focus();
                document.getElementById('txtTaskStrategyID').value = rtnValue;
            }
        }

        //弹出窗口选择货位
        function selectEquipmentProfile(value) {
            var rtnValue = popModalWindow('../Configuration/EquipmentProfileQuery.aspx?action=txtUserID', 'dialogWidth=800px;dialogHeight=500px;center=yes;resizable=yes;status=no;');
            if (rtnValue != null && rtnValue.toString() != "") {
                document.getElementById('txtEquipmentProfileID').focus();
                document.getElementById('txtEquipmentProfileID').value = rtnValue;
            }
        }
        function confirmMsg(code) {
            
             if (code == "C010") {
                if (confirm('<%=GetGlobalMsgResource("C010") %>')) {
                    return true;
                }
                else {
                    return false;
                }
            }           
        }
    </script>

</head>
<body>
    <form id="F6041" runat="server">
    <div>
        <div id="div_top">
            <table>
                <tr>
                    <td valign="bottom">
                        <asp:Label ID="lblUserLicense" runat="server" CssClass="label_header" Text="用户许可"
                            meta:resourcekey="lblOwner"></asp:Label>
                    </td>
                    <td>
                        <asp:Button ID="btnGoBack" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnGoBack%>"
                            CausesValidation="False" OnClick="btnGoBack_Click" Enabled="false" />
                    </td>
                    <td>
                        <asp:Button ID="btnNew" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnNew%>"
                            AccessKey="n" OnClientClick="newUserLicense();return false;" Enabled="false" />
                    </td>
                    <td>
                        <asp:Button ID="btnSave" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnSave%>"
                            AccessKey="s" OnClick="btnSave_Click"  Enabled="false"/>
                    </td>
                    <td>
                        <asp:Button ID="btnDelete" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnDelete%>"
                            OnClick="btnDelete_Click"  Enabled="false" />
                    </td>
                    <td>
                        <asp:Button ID="btnCopy" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnCopy%>"
                            AccessKey="c" OnClick="btnCopy_Click" Enabled="false"  />
                    </td>
                </tr>
            </table>
        </div>
        <div>
            <asp:Label ID="lblMsg" runat="server" CssClass="label_message" meta:resourcekey="lblMsg"></asp:Label>
        </div>
        <div id="div_menu">
            <div style="float: left; width: 8px;">
                <div class="tabL" id="divL1">
                </div>
            </div>
            <div style="float: left;" class="tabLabelCont tabCur" onclick="setTab('one',1,2)"
                id="divM1">
                <asp:Label ID="one1" CssClass="hover" runat="server">常规</asp:Label></div>
            <div style="float: left; margin-right: 2px;">
                <div class="tabR" id="divR1">
                </div>
            </div>
            <div style="float: left; width: 8px;">
                <div class="tabL_1" id="divL2">
                </div>
            </div>
            <div style="float: left;" class="tabLabelCont tabCur_1" onclick="setTab('one',2,2);"
                id="divM2">
                <asp:Label ID="one2" CssClass="navigationlabel" runat="server">区域</asp:Label></div>
            <div style="float: left; margin-right: 2px;">
                <div class="tabR_1" id="divR2">
                </div>
            </div>
        </div>
        <div id="div_content">
            <div id="con_one_1" style="display: block;">
                <table width="720px" style="display: block; margin-left: 10px; margin-top: 10px;">
                    <tr>
                        <td width="180px">
                            <asp:Label ID="lblUserID" CssClass="label" runat="server" Text="用户" meta:resourcekey="lblStatus"></asp:Label>
                        </td>
                        <td width="180px">
                            <asp:Label ID="lblTaskStrategyID" CssClass="label" runat="server" Text="任务分派规则" meta:resourcekey="lblStatus"></asp:Label>
                        </td>
                        <td width="180px">
                        </td>
                        <td width="180px">
                        </td>
                    </tr>
                    <tr>
                        <td width="180px">
                            <asp:TextBox ID="txtUserID" runat="server" CssClass="textbox" MaxLength="20"></asp:TextBox><img
                                src="../Images/icon_find.gif" id="img1" runat="server" alt="select one item"
                                onclick="selectUser('txtUserID')" class="img" />
                        </td>
                        <td width="180px">
                            <asp:TextBox ID="txtTaskStrategyID" runat="server" CssClass="textbox" 
                                meta:resourcekey="txtPoID"></asp:TextBox><img
                                src="../Images/icon_find.gif" id="img2" runat="server" alt="select one item"
                                onclick="selectDispatchRule('txtTaskStrategyID')" class="img" />
                        </td>
                        <td width="180px">
                        </td>
                        <td width="180px">
                        </td>
                    </tr>
                    <tr>
                        <td width="180px">
                            <asp:Label ID="lblUserGroup" runat="server" CssClass="label" Text="用户组" meta:resourcekey="lblOwnerID"></asp:Label><font
                                class="must_input">*</font>
                        </td>
                        <td width="180px">
                            <asp:Label ID="lblEquipmentProfileID" runat="server" CssClass="label" Text="设备类型"
                                meta:resourcekey="lblReceiptType"></asp:Label>
                        </td>
                        <td width="180px">
                        </td>
                        <td width="180px">
                        </td>
                    </tr>
                    <tr>
                        <td width="180px">
                            <asp:TextBox ID="txtUserGroup" runat="server" CssClass="textbox" meta:resourcekey="txtOwnerID"></asp:TextBox>
                        </td>
                        <td width="180px">
                            <asp:TextBox ID="txtEquipmentProfileID" runat="server" CssClass="textbox" 
                                meta:resourcekey="txtPoID" ></asp:TextBox><img
                                src="../Images/icon_find.gif" id="img3" runat="server" alt="select one item"
                                onclick="selectEquipmentProfile('txtEquipmentProfileID')" class="img" />
                        </td>
                        <td width="180px">
                        </td>
                    </tr>
                    <tr style="height: 10px;">
                        <td>
                            &nbsp;
                        </td>
                        <td>
                        </td>
                        <td>
                        </td>
                        <td>
                        </td>
                    </tr>
                </table>
            </div>
            <div id="con_one_2" style="display: none">
                <table width="900px" style="display: block; margin-left: 10px; margin-top: 10px;">
                    <tr>
                        <td>
                            <table>
                                <tr>
                                    <td>
                                        <asp:Button ID="btnAddDetail" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnAddDetail%>"
                                            OnClientClick="javascript:if(document.getElementById('hdnUserLicenseID').value == ''){if(confirm('用户许可主信息尚未保存,是否继续,继续则自动保存主信息.')) return true; else return false;}"
                                            OnClick="btnAddDetail_Click" Enabled="false" />
                                    </td>
                                    <td>
                                        <asp:Button ID="btnDeleteDetail" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnDeleteDetail%>"
                                            OnClientClick="javascript:if(confirmMsg('C010')) return true; else return false;"
                                            OnClick="btnDeleteDetail_Click" Enabled="false" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr style="height: 10px;">
                        <td>
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div>
                                <asp:GridView ID="gvUserLienseDetail" runat="server" AllowSorting="True" 
                                    AutoGenerateColumns="False" CssClass="gridview"  DataKeyNames="LineID"
                                         onrowdatabound="gvUserLienseDetail_RowDataBound"  oninit="gvUserLienseDetail_Init" 
                                     AllowPaging="True" 
                                    OnPageIndexChanging="gvUserLienseDetail_PageIndexChanging" 
                                    onsorting="gvUserLienseDetail_Sorting" >
                                    <FooterStyle CssClass="GridViewFooterStyle" />
                                    <RowStyle CssClass="GridViewRowStyle" />
                                    <HeaderStyle CssClass="GridViewHeaderStyle" />
                                    <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                                    <Columns>
                                        <asp:BoundField HeaderText="序号" FooterText="序号" meta:resourcekey="BoundField">
                                            <ItemStyle CssClass="GridViewRowWidth_40" />
                                        </asp:BoundField>
                                        <asp:TemplateField meta:resourcekey="TemplateField">
                                            <HeaderTemplate>
                                                <asp:CheckBox ID="CheckBox1" runat="server" onclick="selectAll(this,'gvUserLienseDetail');"
                                                    meta:resourcekey="CheckBox1" />
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="chbSelect" runat="server" meta:resourcekey="chbSelect" />
                                            </ItemTemplate>
                                            <FooterTemplate>
                                                <asp:CheckBox ID="CheckBox2" runat="server" onclick="selectAll(this,'gvUserLienseDetail');"
                                                    meta:resourcekey="CheckBox2" />
                                            </FooterTemplate>
                                            <HeaderStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_40" />
                                            <ItemStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_40" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="行号" FooterText="行号" SortExpression="LineID">
                                            <ItemTemplate>
                                                <asp:HyperLink ID="HyperLink1" runat="server" Text='<%# Eval("LineID") %>' NavigateUrl='<%# FormatUrl("~/TaskMgmt/UserLicenseDetail.aspx?from=list&ID={0}&LineID={1}&Type=1",Eval("UserID").ToString(),Eval("LineID").ToString()) %>'
                                                    Target="_self" CssClass="hyperlink" meta:resourcekey="HyperLink1"></asp:HyperLink>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="PermissionType" HeaderText="任务类型" FooterText="任务类型" SortExpression="PermissionType">
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="AreaID" HeaderText="区域" FooterText="区域" SortExpression="AreaID">
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="Permission" HeaderText="许可" FooterText="许可" SortExpression="Permission"
                                            meta:resourcekey="TASK_STRATEGY_ID">
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="AllowPiece" HeaderText="件拣货" FooterText="件拣货" SortExpression="AllowPiece"
                                           >
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="AllowCase" HeaderText="箱拣货" FooterText="箱拣货" SortExpression="AllowCase"
                                            meta:resourcekey="UserGroup">
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="AllowIps" HeaderText="内包装拣货" FooterText="内包装拣货" SortExpression="AllowIps"
                                            meta:resourcekey="UserGroup">
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="AllowPallet" HeaderText="托盘拣货" FooterText="托盘拣货" SortExpression="AllowPallet"
                                            meta:resourcekey="UserGroup">
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>
                                    </Columns>
                                </asp:GridView>
                            </div>
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr style="height: 30px;">
                        <td>
                        </td>
                        <td>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <input type="hidden" id="hiddenFlag" />
        <input type="hidden" id="hdnLineID" runat="server" />
        <input id="hdnUserLicenseID" runat="server" type="hidden" />
        <input id="hdnFlag" runat="server" type="hidden" />
        <input id="hdnCopy" runat="server" type="hidden" />
        <input id="hdnFrom" runat="server" type="hidden" />
          <input id="hdnLine" runat="server" type="hidden" />
    </div>
    </form>
</body>
</html>
